#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#define N 2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define sd(n) scanf("%d",&n)
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)

//----------------------------------------------------------------------------//
int n;
int main()
{
    sd(n);
    
    ll ans=0;
    for(int i=0;i<n;i++)
    {
		ll x;
		sld(x);
		if(x>0)
		{
			if(x%2==0) 
			{
				ll xx=x;
				while(xx%2==0) xx/=2;
				ans+=xx;
			}
			else ans+=x;
		}
		else if(x<0) ans+=x;
		else if(x==0) ans+=0;
		


	}
	
	pld(ans);
	puts("");
    return 0;
}
